home *** CD-ROM | disk | FTP | other *** search
- /* $Id: todo.h,v 1.4 1999/07/07 01:48:34 chrisf Exp $ */
-
- /*
- Hot Date - A DatebookDB displayer for the PalmPilot
- Copyright (C) 1999 Chris Faherty
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- as published by the Free Software Foundation; either version 2
- of the License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- */
-
- #ifndef __TODO_H__
- #define __TODO_H__
-
- #include <DateTime.h>
-
- #define LocalizedAppInfoStr 1000
-
- #define todoLabelLength 12
- #define todoNumFields 16
-
- #define toDoMaxPriority 5
-
- /* Dirty flags for to do application info */
- #define toDoSortByPriorityDirty 0x0001
-
- /* Sort orders */
- #define soDueDatePriority 0
- #define soPriorityDueDate 1
- #define soCategoryPriority 2
- #define soCategoryDueDate 3
-
- typedef struct {
- UInt renamedCategories; /* bitfield of categories with a different name */
- char categoryLabels[dmRecNumCategories][dmCategoryLength];
- Byte categoryUniqIDs[dmRecNumCategories];
- Byte lastUniqID; /* Uniq IDs generated by the device are between */
- /* 0 - 127. Those from the PC are 128 - 255. */
- Byte reserved1; /* from the compiler word aligning things */
- Word reserved2;
- UInt dirtyAppInfo;
- Byte sortOrder;
- } ToDoAppInfoType;
-
- typedef ToDoAppInfoType * ToDoAppInfoPtr;
-
- /*
- * ToDoDBRecord.
- *
- * All strings are null terminated and appear within the record.
- */
- typedef struct {
- DateType dueDate;
- unsigned char priority; /* high bit is complete flag */
- char description;
- } ToDoDBRecord;
-
- typedef ToDoDBRecord * ToDoDBRecordPtr;
-
- /*
- * sizeDBRecord is the minimum size for the ToDoDBRecord structure.
- * It assumes empty 'description' and 'note' fields.
- * sizeDBRecord allocates an extra byte for the null character
- * for the note string.
- */
- #define sizeDBRecord (sizeof(ToDoDBRecord) + 1)
-
- /*
- * ToDoItemType
- *
- * This is the format of a to do record used by the application. All
- * pointers are either NULL or point to data within the PackedDB record.
- * All strings are null character terminated.
- */
- typedef struct {
- DateType dueDate;
- unsigned char priority; /* high bit is complete flag */
- CharPtr description;
- CharPtr note;
- } ToDoItemType;
-
- typedef ToDoItemType * ToDoItemPtr;
-
- #define completeFlag 0x80
- #define priorityOnly ~completeFlag
- #define toDoNoDueDate 0xffff
-
- /* Used for ToDoChangeRecord. */
- typedef enum {
- toDoPriority,
- toDoComplete,
- toDoDueDate,
- toDoDescription,
- toDoNote,
- toDoCategory } ToDoRecordFieldType;
-
- /*
- * Function prototypes
- */
- UInt GetToDo(DmOpenRef dbP, DateType date, Word days, VoidHand apptLists [],
- UInt counts []);
- void SelectCategoryPopup(DmOpenRef dbP, TablePtr table, Word row);
-
- #endif __TODO_H__
-